
Partial Class WebPartUserControl
    Inherits System.Web.UI.UserControl

    Protected Sub btnCustomize_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnCustomize.Click
        Dim wpm As System.Web.UI.WebControls.WebParts.WebPartManager
        Dim wp As WebPart

        wpm = WebPartManager.GetCurrentWebPartManager(Me.Page)
        wpm.DisplayMode = WebPartManager.CatalogDisplayMode
        wp = wpm.CreateWebPart(Me.txtUserControl)
        Dim stz As String
        stz = wpm.GetExportUrl(wp)
        'Response.Redirect(stz)

    End Sub
End Class
